package day7;

/*
属性给其他地方用，但是又要限制合理性
思考：
  读   getXxxxx..
  写   setXxxxx..

  javabean  ：只写属性和get,set方法。 不写业务方法。
    spring  mybatis . xxx.xxx
 */
public class User {

    public User(String username, String password, int age) {
        this();
        this.username = username;
        this.password = password;
        this.age = age;
    }
    public User() {
//        this("admin", "123", 100);
        System.out.println("执行无参构造");
    }

    private String username;
    private String password;
    private int age;

    // alt + insert
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", age=" + age +
                '}';
    }
}
